package com.ruiysoft.service.order;

import com.ruiysoft.controller.order.vo.OrderBuyerVO;
import com.ruiysoft.controller.order.vo.OrderPlaceCusVo;
import com.ruiysoft.controller.order.vo.ShopVO;
import com.ruiysoft.entity.common.UserInfo;
import com.ruiysoft.entity.order.OrderMain;
import com.ruiysoft.entity.order.OrderReceiverInfo;
import com.ruiysoft.pub.core.Result;
import com.ruiysoft.pub.entity.PageInfo;
import com.ruiysoft.service.order.bean.OrderDto;
import com.ruiysoft.service.order.bean.OrderIntfResultDto;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Set;

/**
 * Date : 2018/11/2
 *
 * @author WenJialu
 */
public interface IOrderWechatService {
	/**
	 * 订单详情
	 * @param orderNo
	 * @return
	 */
	OrderDto findOrderWithDetailByOrderNo(String orderNo);

	/**
	 * 订单详情
	 * @param orderNo
	 * @return
	 */
	OrderDto findOrderWithDetailByOrderNo(UserInfo userInfo, String orderNo);

	/**
	 * 订单详情
	 * @param orderNo
	 * @return
	 */
	OrderDto findOrderWithDetailByOrderNo(Long shopId, String orderNo);

	/**
	 * 订单列表
	 *
	 * @param userInfo
	 * @param status
	 * @param pageStart
	 * @param pageSize
	 * @return
	 */
	PageInfo<OrderDto> findOrders(UserInfo userInfo, @Valid Set<Integer> status, @NotNull @Valid Integer pageStart, @NotNull @Valid Integer pageSize);

	/**
	 * 下单
	 * @param userInfo
	 * @return
	 */
	//Result<OrderIntfResultDto> orderPlace(UserInfo userInfo, @Valid OrderPlaceCusVo orderPlaceVo);
	Result<OrderIntfResultDto> orderPlace(UserInfo userInfo, @Valid OrderIntfResultDto orderIntfResultDto);

	//public Result<Map> frontendGoingPay(){};
	Result<Void> frontendPaid(UserInfo userInfo, String orderNo, boolean isPaidSuccess);


	/**
	 * 订单预览 运费 商品信息等
	 *
	 * @param shopVO ShopVO
	 * @param buyerVO OrderBuyerVO
	 * @param orderPlaceVo OrderPlaceCusVo
	 * @return
	 */
	Result<OrderIntfResultDto> orderPrePlace(ShopVO shopVO, OrderBuyerVO buyerVO, @Valid OrderPlaceCusVo orderPlaceVo);

	/**
	 * 最后一次收货地址信息
	 * @param userId
	 * @return
	 */
	OrderReceiverInfo findLastestReceiverInfo(Long userId);

	/**
	 * 取消订单
	 * @param orderNo
	 * @param userId
	 * @return
	 */
	Result orderCancel(String orderNo, Long userId, String remark);

	/**
	 * 取消订单：后台调用，无需验证用户
	 * @param orderNo
	 * @return
	 */
	Result orderCancel(String orderNo,String remark);



	/**
	 * 确认收货
	 * @param orderNo
	 * @return
	 */
	Result<OrderMain> orderConfirmReceipt(String orderNo, Long userId);
}
